#ifndef CSG_H
#define CSG_H

#include "csg_type.h"
#include <vector>

using namespace std;

//!  A Constructive Solid Geometry (CSG) class.
/*!
  The CSG class supports boolean operations (union, subtract, intersect) of two meshes.
*/
class CSG {
public:
    //! All polygons of a mesh.
    vector<MyPolygon> polygons;

    //! A constructor.
    CSG();

    //! Construct a CSG class from polygons.
    static CSG* fromPolygons(vector<MyPolygon> polygons);

    //! Clone a new CSG from this CSG.
    CSG* clone();

    //! Return all polygons in CSG.
    vector<MyPolygon> toPolygons();

    //! Union operation.
    CSG* csg_union(CSG* csg);

    //! Subtract operation.
    CSG* csg_subtract(CSG* csg);

    //! Intersect operation.
    CSG* csg_intersect(CSG* csg);

    //! Inverse operation.
    CSG* inverse();
};

#endif // CSG_H
